/*
  Class for one trade
  */

#ifndef TRADE_H
#define TRADE_H

#include <QObject>
#include <QList>
#include <QStandardItem>
#include <QMap>
#include <QString>
#include <QStringList>

class Trade : public QObject
{
    Q_OBJECT
public:
    explicit Trade(QObject *parent = 0);
    explicit Trade(const QStringList& valSymbols,QObject *parent=0);
    explicit Trade(const QStringList &valSymbols,const QStringList& values, QObject *parent=0);

    void addValue(const QString &valSymbol, QVariant value);
    void addValue(const QMap<QString,QVariant>& values);

    QString getValue(const QString& valSymbol) const;
    QStringList getValues()const;
    QMap<QString,QVariant> getValueMap()const;

    QList<QStandardItem*> getAllItems();
    QMap<QString,QStandardItem*> getItemMap();

    void setStockName(const QString& stockName);
    QString getStockName()const;
signals:
    
public slots:
private:
    QMap<QString,QStandardItem*> values;        //trade values <valSymbol,value>
    QString stockName;                          //the stock name which this trade belongs to
};

#endif // TRADE_H
